<?php
/**
 * User: dengyue
 * Date: 2020-07-31
 * Time: 16:17
 */

namespace App\Libraries\Common;


class Errors
{
    private static $_error;

    public static function setError($code, $msg = '', $data = [])
    {
        self::$_error = compact('code', 'msg', 'data');
        return false;
    }

    public static function getError()
    {
        return self::$_error ? : ['code' => 99, 'msg' => '未知错误'];
    }
}